using Unity.Entities;

public readonly partial struct ShderAnimAspect : IAspect {
	readonly RefRW<URPMaterialPropertyCurTime> m_URPMaterialPropertyCurTime;
	readonly RefRW<URPMaterialPropertyStartTime> m_URPMaterialPropertyStartTime;
	readonly RefRW<URPMaterialPropertyEndTime> m_URPMaterialPropertyEndTime;
	readonly RefRW<URPMaterialPropertyIsLoop> m_URPMaterialPropertyIsLoop;

	public void UpdateCurTime(float dt) {
		m_URPMaterialPropertyCurTime.ValueRW.Value += dt;
	}

	public void UpdateAnim(float newStartTime, float newEndTime, float newIsLoop) {
		m_URPMaterialPropertyStartTime.ValueRW.Value = newStartTime;
		m_URPMaterialPropertyEndTime.ValueRW.Value = newEndTime;
		m_URPMaterialPropertyIsLoop.ValueRW.Value = newIsLoop;
		m_URPMaterialPropertyCurTime.ValueRW.Value = 0;
	}
}
